package com.collect.tanzania.zhiScene.zhiAuditer.zhiFollow.zhiReview;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.tanzania.R;
import com.collect.tanzania.zhiBean.zhiReceive.ZHIRAuditerReviewCallogEntity;

public class ZHIAduiterCallogListAdjuster extends BaseQuickAdapter<ZHIRAuditerReviewCallogEntity, BaseViewHolder> {

    public ZHIAduiterCallogListAdjuster() {
        super(R.layout.item_auditer_calllog_list, null);
    }

    private OnAuditerCalllogtItemClickListener mListener;

    @Override
    protected void convert(BaseViewHolder helper, final ZHIRAuditerReviewCallogEntity caseEntity) {

        helper.setText(R.id.tv_calllog_duration, caseEntity.getName());
        helper.setText(R.id.tv_calllog_phone, caseEntity.getMobile());

        if (mListener != null) {
            helper.getView(R.id.image_calllog_copy).setOnClickListener(view -> mListener.OnItemClick(caseEntity, false));
            helper.getView(R.id.image_calllog_call).setOnClickListener(view -> mListener.OnItemClick(caseEntity, true));
        }
    }

    public void setOnItemClickListener(OnAuditerCalllogtItemClickListener onOrderItemClickListener) {
        this.mListener = onOrderItemClickListener;
    }

    public interface OnAuditerCalllogtItemClickListener {
        void OnItemClick(ZHIRAuditerReviewCallogEntity caseEntity, boolean isDailAction);
    }
}